<template>
  <el-popover
    placement="left"
    width="320"
    trigger="click"
    v-model:visible="showSmartGuidePopover"
    popper-class="smart-guide-popover"
  >
    <template #reference>
      <div class="smart-guide-float">
        <i class="fas fa-robot"></i>
        <span>智能导诊</span>
      </div>
    </template>
    <div class="smart-guide-dialog-content">
      <i class="fas fa-robot smart-guide-dialog-icon"></i>
      <div class="smart-guide-dialog-text">
        不确定挂哪个科？<br />推荐使用 <b>智能导诊</b>，快速定位就诊科室
      </div>
      <el-button class="smart-guide-btn" type="success" @click="goSmartGuide" style="margin-top:18px;">
        去智能导诊
        <i class="fas fa-arrow-right" style="margin-left:6px;"></i>
      </el-button>
    </div>
  </el-popover>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const showSmartGuidePopover = ref(false);
const router = useRouter();
const goSmartGuide = () => {
  router.push('/aiDoctor');
  showSmartGuidePopover.value = false;
};
</script>

<style scoped lang="scss">
.smart-guide-float {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 2000;
  background: linear-gradient(135deg, #e0f7fa 60%, #f8fafc 100%);
  color: var(--primary-blue);
  border-radius: 18px 0 0 18px;
  box-shadow: 0 2px 12px rgba(32,201,151,0.13);
  padding: 14px 18px 14px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.13rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.18s, background 0.18s;
}
.smart-guide-float:hover {
  background: linear-gradient(135deg, #b2f0e6 60%, #e0f7fa 100%);
  box-shadow: 0 4px 18px rgba(32,201,151,0.18);
}
.smart-guide-float i {
  font-size: 1.5rem;
  color: var(--accent-teal);
}
@media (max-width: 768px) {
  .smart-guide-float {
    top: unset;
    bottom: 80px;
    right: 12px;
    transform: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-size: 1rem;
  }
}
.smart-guide-dialog-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 0 0;
}
.smart-guide-dialog-icon {
  font-size: 2.5rem;
  color: var(--accent-teal);
  margin-bottom: 12px;
}
.smart-guide-dialog-text {
  font-size: 1.13rem;
  color: var(--primary-blue);
  text-align: center;
  font-weight: 500;
  margin-bottom: 8px;
}
::v-deep(.smart-guide-popover) {
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(32,201,151,0.13);
  padding: 18px 12px 18px 12px;
  min-width: 260px;
  max-width: 340px;
}
</style> 